//package com.simga.simgalibrary.activity;
//
//import android.os.Bundle;
//import android.support.v7.widget.LinearLayoutManager;
//import android.support.v7.widget.RecyclerView;
//
//import com.simga.simgalibrary.R;
//import com.simga.simgalibrary.widget.Divider;
//import com.simga.simgalibrary.widget.refreshlayout.RefreshLayout;
//import com.simga.simgalibrary.widget.refreshlayout.RefreshLayoutDirection;
//
//
///**
// * Created by longbh on 16/5/31.
// */
//public abstract class BaseListFragment extends BaseFragment {
//    protected RecyclerView listView;
//    protected RefreshLayout refreshLayout;
//    protected int page = 1;
//
//    protected boolean mIsCreate;
//    @Override
//    protected int getViewId() {
//        return R.layout.fragment_base_list;
//    }
//
//    @Override
//    protected void init(Bundle savedInstanceState) {
//        if(!mIsCreate) {
//            refreshLayout = (RefreshLayout) mRootView.findViewById(R.id.ref_layout);
//            listView = (RecyclerView) mRootView.findViewById(R.id.list);
//            RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(mContext);
//            listView.setLayoutManager(layoutManager);
//            listView.setHasFixedSize(true);
//            listView.setAdapter(getAdapter());
//            if (isAddItemDecoration()) {
//                listView.addItemDecoration(new Divider(mContext));
//            }
//
//            refreshLayout.setOnRefreshListener(new RefreshLayout.OnRefreshListener() {
//                @Override
//                public void onPullDownToRefresh() {
//                    page = 1;
////                mContext.loading.show();
//                    loadPageData(page);
//                }
//
//                @Override
//                public void onPullUpToRefresh() {
//                    page++;
//                    loadPageData(page);
//                }
//            });
//            getDataRequest();
//            mIsCreate = true;
//        }
//    }
//
//    protected void onLoad(int size) {
//        if (refreshLayout == null) {
//            return;
//        }
//        if (refreshLayout.isRefreshing()) {
//            refreshLayout.setRefreshing(false);
//        }
//        if (size < 10) {
//            refreshLayout.setDirection(RefreshLayoutDirection.TOP);
//        } else {
//            refreshLayout.setDirection(RefreshLayoutDirection.BOTH);
//        }
////        mContext.loading.dismiss();
//    }
//
//    public abstract void loadPageData(int page);
//    public abstract void getDataRequest();
//
//    public abstract RecyclerView.Adapter getAdapter();
//
//    protected boolean isAddItemDecoration() {
//        return true;
//    }
//}
